package com.java01.apache.commons.io;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileSystemUtils;

public class DiskSpaceSnippet {

	public static void main(String[] args) {
		for(File disk:File.listRoots()){
			System.out.println("free space:"+disk.getFreeSpace());
			
			try {
				long freeSpaceKb = FileSystemUtils.freeSpaceKb(disk.getPath());
				System.out.println("free space kb:"+freeSpaceKb);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
